<!-- 头部 -->
<include file="Public:header" />
<link href="__PUBLIC__/home/css/main2_9.css" rel="stylesheet" type="text/css"media="all" />

<div class="mian_nav">
<div class="mycenter">

<div class="nav_box">
<ul>
    <li class="home"><a href="{:U('index/index',array('newcity'=>$city))}" target="_self">首页</a></li>
    <li><a href="{:U('index/jiazhang_zn',array('newcity'=>$city))}" target="_self">学员指南</a></li>
    <li><a href="{:U('index/laoshi_zn',array('newcity'=>$city))}" target="_self">老师指南</a></li>
    <li><a href="{:U('index/about',array('newcity'=>$city))}" target="_self">关于平台</a></li>
</ul>
<div class="nav-line" style="left:92px;width:64px;"></div>
</div>
<!-- 首页显示 -->
<div class="hls_slogan" id="hls_slogan"></div>

</div>
</div>

</header>
	<div class="need_table_bg">
		<div class="auto1200 position">
			<div class="need_table_step fl">
				<p>帮您推荐老师</p>
				<div class="need_setpdetails">
					<div class="word_step">
						<p>家长提交需求信息</p>
						<p>课程顾问跟您联系</p>
						<p>帮您推荐合适老师</p>
						<p>预约试听老师课程</p>
						<p>课程顾问确认费用</p>
            <p>线下教学结课续费</p>
					</div>
				</div>
				<p class="warm_phone">老师上门客服电话：020-39936776</p>
			</div>
          <form class="layui-form" method="post">
             <div class="need_table_details" style="top:120px;">
            <p>需求单</p>
            <div class="table_row">
              <lable><i>*</i>学生姓名</lable>
              <input name="name" placeholder="学生姓名" type="text" required lay-verify="required">       
            </div>

            <div class="layui-inline">
              <label class="layui-form-label" style="text-align: -webkit-auto;width: 90px;margin-left: -10px;padding: 8px 10px;"><i style="color:#f32938">*</i>年级类别</label>
              <div class="layui-input-inline" style="width: 301px;margin-left: -8px;border: 1px solid #a9a9a9;margin-bottom: 10px;">
                  <select name="grade" id="" required lay-verify="required">
                      <option value="">请选择年级</option>
                      <?php foreach ($grades as $v) { ?>
                          <option value="{$v['grade_name']}"{$v['grade_name']==$grade?"selected":'' }>{$v.grade_name}</option>
                      <?php } ?>
                  </select> 
              </div>
            </div>

            <div class="layui-inline">
              <label class="layui-form-label" style="text-align: -webkit-auto;width: 90px;margin-left: -10px;padding: 8px 10px;"><i style="color:#f32938">*</i>老师科目</label>
              <div class="layui-input-inline" style="width: 301px;margin-left: -8px;border: 1px solid #a9a9a9;margin-bottom: 10px;">
                  <select name="kemu" id="" required lay-verify="required">
                      <option value="">请选择科目</option>
                      <?php foreach ($kemus as $v) { ?>
                          <option value="{$v['name']}"{$v['name']==$kemu?"selected":'' }>{$v.name}</option>
                      <?php } ?>
                  </select> 
              </div>
            </div>

            <div class="table_row">
                <lable><i>*</i>上课地址</lable>
                <input name="addr" placeholder="请填写大致位置或区域,等待课程顾问回访" type="text" required lay-verify="required" >
            </div>

            <div class="table_row">
              <lable><i>*</i>手机号码</lable>
              <input name="phone" placeholder="请填写手机号码" type="text" required lay-verify="required" >
            </div>

            <div class="table_row">
              <lable><i>*</i>要求备注</lable>
              <input name="beizhu" placeholder="请填写要求备注" type="text" required lay-verify="required" >
            </div>

            <input name="city" type="hidden" value="{$city}">
            <button class="nt_btn-orig layui-btn layui-btn-warm" lay-filter="*" lay-submit>确认提交</button>
            <p class="calm_down">* 老师上门严格保密您的信息，请放心提交</p>
             </div>
          </form>
		</div>
	</div>
<!-- 	<div class="need_table_footer">
    <div class="auto1200">
        <p>Copyright&nbsp;©&nbsp;2015-2019 laoshism.com<span>|</span>粤ICP备16129133号<span></p>
    </div>
   <a href="javascript:void(0);" class="arrow-up" id="arrowup">&nbsp;</a>
</div> -->
<!-- 尾部 -->
<include file="Public:fooder" />

<script type="text/javascript">
    layui.use(['form','layer'], function(){
      var layer = layui.layer
      ,form = layui.form();
      //layer.msg('Hello World');

      //交互
    form.on('submit(*)', function(data){
      //console.log(arr);
        $.ajax({
            url: "{:U('jiazhang/zhao_laoshi_add')}",//请求地址
            type: "post",//请求方式
            dataType: "json",//返回数据类型
            data: data.field,//发送的参数
            })
            .done(function(response) {
                  if(response.error==0){
                     layer.msg(response.info ,{icon:5});

                  }else{
                     layer.msg(response.info ,{icon:6});
                     location.reload();
                  }
              })
            .fail(function() {
                alert("ajxs交互失败");
            })  

          return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });   

    });
</script>
</body></html>